<%@ page contentType="text/html; charset=utf-8" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>日程管理</title>
        <link href="../style/main.css" rel="stylesheet" type="text/css" />
        <link type="text/css" rel="stylesheet" href="../style/style.css" />

<%@ taglib prefix="s" uri="/struts-tags" %>

<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-bottom: 0px;
}
-->
</style>
<style type="text/css">
<!--
a:visited {
	color: #000000;
	text-decoration: none;
}
a:hover {
	color: #FF0000;
	text-decoration: none;
}
a:active {
	color: #0066FF;
	text-decoration: none;
}
a:link {
	color:#3333CC;
	text-decoration: none;
}
.STYLE2 {
	font-size: 18px;
	font-weight: bold;
}
.table {
	border-top-width: medium;
	border-right-width: medium;
	border-bottom-width: medium;
	border-left-width: medium;
	border-top-style: double;
	border-right-style: none;
	border-bottom-style: none;
	border-left-style: none;
	border-top-color: #999999;
	border-right-color: #999999;
	border-bottom-color: #999999;
	border-left-color: #999999;
}
.STYLE3 {font-size: 12px}
-->
</style>

<script type="text/javascript">
	function showAddForm(flag)
	{
		if(flag)
		{
			document.getElementById("editPlanDiv").style.display="";
		}
		else
		{
			document.getElementById("editPlanDiv").style.display="none";
		}
	}
	function addNewAgenda()
	{
		editPlanForm.submit();
	}
</script>

<%
		Integer hours[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23};
		Integer minutes[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,
							21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,
							41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59};
		request.setAttribute("hours",hours);
		request.setAttribute("minutes",minutes);
 %>

</head>
<body>
<div>
<div class="search">
	<table width="100%" border="0" align="left" cellpadding="0" cellspacing="2" class="table4">
      <tr bgcolor="#BBD2F7">
        <th height="25" colspan="4" class="title">
            	日程安排
        </th>
        <th height="25">
            <span style="color:#666">
            	[<a href="javascript:void(0);" onclick="javascript:showAddForm(true);">添加日程</a>]
            </span>
        </th>
      </tr>
      <tr bgcolor="#BBD2F7">
        <td width="30%" height="25" align="left" bordercolor="#FF00FF" bgcolor="#FAFBDC"><span style="color:#666">主题</span></td>
        <td width="18%" height="25" align="left" bordercolor="#FF00FF" bgcolor="#FAFBDC"><span style="color:#666">开始时间</span></td>
        <td width="18%" height="25" align="left" bordercolor="#FF00FF" bgcolor="#FAFBDC"><span style="color:#666">结束时间</span></td>
        <td width="20%" height="25" align="left" bordercolor="#FF00FF" bgcolor="#FAFBDC"><span style="color:#666">地点</span></td>
        <td width="14%" height="25" align="left" bordercolor="#FF00FF" bgcolor="#FAFBDC"><span style="color:#666">操作</span></td>
      </tr>
      <s:iterator value="#request.agendaList" status="st" id="agendaList">
	      <tr>
	        <td align="left" class="style3">
	        	<s:property value="agendaTitle" />
	        </td>
	        <td align="left" class="style3">
	        	<s:date name="agendaStart" format="yyyy-MM-dd HH:mm" />
	        </td>
	        <td align="left" class="style3">
	        	<s:date name="agendaDue" format="yyyy-MM-dd HH:mm" />
	        </td>
	        <td align="left" class="style3">
	        	<s:property value="agendaAddress" />
	        </td>
	        <td align="left" class="style3">
	           	<a href="agenda!startEdit?agendaId=<s:property value='agendaId' />">修改</a>&nbsp;&nbsp;
	           	<a href="agenda!removeAgenda?agendaId=<s:property value='agendaId' />"> 删除</a>
	        </td>
	      </tr>
      </s:iterator>

      <tr>
        <td height="30" class="STYLE3" colspan=6>
            <!-- <div align="center" class="STYLE3"><INPUT TYPE="button" value="新增日程"></div> -->
        </td>
      </tr>
    </table>
</div>
<div class="clear"></div>
<div id="editPlanDiv" class="search" style="display: none">
    <s:form id="editPlanForm" name="editPlanForm" action="agenda!addAgenda" method="post" theme="simple">
    	
    	<s:hidden name="agendaDate"></s:hidden>
        <table width="100%" border="0" align="left" cellpadding="0" cellspacing="2" class="table4">
            <tr>
                <th height="25" colspan="6" bgcolor="#BBD2F7" class="title">
                    	添加日程
                </th>
            </tr>
            <tbody>
              <tr>
                <th width="120">主&nbsp;&nbsp;&nbsp;&nbsp;题：</th>
                <td colspan="4">
                	<s:textfield name="agenda.agendaTitle" cssStyle="width:400px" />
                </td>
                <td></td>
              </tr>
              <tr>
                <th>日&nbsp;&nbsp;&nbsp;&nbsp;期：</th>
                <td><s:property value="agendaDate" default=""/></td>
              </tr>
              <tr>
                <th width="120">开始时间：</th>
                <td width="70" style="width:60px">
                	<s:select id="begHour" name="begHour" cssStyle="width:60px"
                				list="#request.hours">
                	</s:select>
                </td>
                <td width="24" style="width:20px">点</td>
                <td width="70" style="width:60px">
                	<s:select id="begMinute" name="begMinute" cssStyle="width:60px"
                				list="#request.minutes">
                	</s:select>
                </td>
                <td width="805">分</td>
                <td></td>
              </tr>
              <tr>
                <th>结束时间：</th>
                <td>
                	<s:select id="endHour" name="endHour" cssStyle="width:60px"
                				list="#request.hours">
                	</s:select>
                </td>
                <td width="24" style="width:20px">点</td>
                <td>
                	<s:select id="endMinute" name="endMinute" cssStyle="width:60px"
                				list="#request.minutes">
                	</s:select>
                </td>
                <td>分</td>
                <td></td>
              </tr>
              <tr>
                <th>地&nbsp;&nbsp;&nbsp;&nbsp;点：</th>
                <td colspan="4">
                	<s:textfield name="agenda.agendaAddress" cssStyle="width:400px" />
                </td>
                <td></td>
              </tr>
            </tbody>
        </table>
    </s:form>
        <div class="clear"></div>
        <table width="100%" cellpadding="0" cellspacing="0"class="table3">
            <tr>
                <td width="60%" >&nbsp;</td>
                <td width="5%" >
                	<a href="javascript:void(0);" onclick="javascript:addNewAgenda();">
                		<span class="clientinfo_but">保&nbsp;存</span>
                	</a>
                </td>
                <td width="5%" >
                	<a href="javascript:void(0);" onclick="javascript:showAddForm(false);">
                		<span class="clientinfo_but">取&nbsp;消</span>
                	</a>
                </td>
                <td width="30%"></td>
            </tr>
        </table>
</div>
</div>
</body>
</html>